package com.szsfm.vehiclemanagement.bean;

import org.greenrobot.greendao.annotation.Convert;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhoubigbo on 2017/12/1.
 */

@Entity
public class PushMessage {

    @Id(autoincrement = true)
    private long id;


    @Property(nameInDb = "timestamp")
    private String timestamp;

    @Property(nameInDb = "data")
    @Convert(columnType = String.class, converter = MessageConverter.class)
    private List<Message> data = new ArrayList<>();

    @Generated(hash = 1338234640)
    public PushMessage(long id, String timestamp, List<Message> data) {
        this.id = id;
        this.timestamp = timestamp;
        this.data = data;
    }

    @Generated(hash = 1468533071)
    public PushMessage() {
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public List<Message> getData() {
        return data;
    }

    public void setData(List<Message> data) {
        this.data = data;
    }

    public long getId() {
        return this.id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "PushMessage{" + "id=" + id + ", timestamp='" + timestamp + '\'' + ", data=" + data + '}';
    }
}
